﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ForfiterStockInfo.Entities
{
    public class Record
    {

        public int Id { get; set; }

        public Stock Stock { get; set; }

        public decimal Price { get; set; }

        public decimal ChangePrice { get; set; }

        public decimal ChangePercent { get; set; }

        public int Volume { get; set; }

        public int Turnover { get; set; }

        public decimal OpeningPrice { get; set; }

        public decimal MaxPrice { get; set; }

        public decimal MinPrice { get; set; }

        public System.DateTime Date { get; set; }


        public class StocksEqualityComparer : IEqualityComparer<Record>
        {
            public bool Equals(Record x, Record y)
            {
                return x.Stock.Name == y.Stock.Name;
            }

            public int GetHashCode(Record obj)
            {
                return obj.Stock.GetHashCode();
            }
        }
    }
}
